<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>{% block title %}OpenQuake engine{% if server_name %} ({{ server_name }}){% endif %}{% endblock %}</title>
  <link href="{{ STATIC_URL }}img/favicon.png" rel="shortcut icon" type="image/png"/>
  <link href="{{ STATIC_URL }}css/base.css" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_URL }}font/lato_font.css" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_URL }}css/assets.min.css" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_URL }}css/engine.css" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_URL }}css/jasny-bootstrap.min.css" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_URL }}lib/outdatedbrowser/outdatedbrowser.min.css" rel="stylesheet" type="text/css" />
  <link href="{{ STATIC_URL }}css/cookie_consent.css" rel="stylesheet"/>
  {% if application_mode != 'PUBLIC' and google_analytics_token is not None %}
  {% include "./includes/cookie_analytics.html" %}
  {% endif %}
</head>
<body>
  {% block header %}
  <div id="header" class="navbar navbar-fixed-top">
    <div class="navbar-inner" style="background: url({{ STATIC_URL }}img/oq-header.png) no-repeat left top; background-color: #1b75a5;">
      <section>
      <div class="container">
        <div class="row">
          <div class="span3">
            <a href="{% url "index" %}"><span class="nav-logo" style="background: url({{ STATIC_URL }}img/oq-logo-engine.png) no-repeat;"></span></a>
          </div>
          <div class="span10 nav-engine-items">
            <nav class="main-nav">
              <ul>
                {% block nav-items %}
                {% if app_list %}
                {# Take the first app in STANDALONE_APPS as landing page for tools #}
                <li class="tools"><a href="{{ app_list.0.url }}">Tools</a></li>
                {% endif %}
                {% if user.is_superuser %}
                <li class="admin"><a href="{% url 'admin:index' %}">Admin</a></li>
                {% endif %}
                {% if user.is_superuser or user.level >= 2 %}
                <li class="manage-tags"><a href="{% url 'tagadmin:db_jobtag_changelist' %}">Manage tags</a></li>
                {% endif %}
                {% endblock nav-items %}
              </ul>
            </nav>
          </div> <!-- ./span10 -->
          <div class="span9">
            <div class="nav-collapse pull-right">
              <div class="pull-right">
                <ul class="nav pull-right account-bar">
                  {% if user.is_authenticated %}
                  <li class="user">
                    Hello, <strong>{{ user.username }}</strong>
                  </li>
                  <li class="user">
                    |
                  </li>
                  <li class="user">
                    <a href="{% url "logout" %}">logout</a>
                  </li>
                  {% endif %}
                  <li class="actions">
                      <a href="{{ help_url }}" id="help_url" rel="tooltip" target="_blank" title="Help"><img src="{{ STATIC_URL }}img/oq-help.png"></a>
                  </li>
                </ul>
              </div>
            </div>
          </div>
          <div id="gem-right-logo">
            <a href="http://www.globalquakemodel.org" title="GEM Foundation" target="_blank"><span class="nav-logo nav-logo-gem" style="background: url({{ STATIC_URL }}img/oq-gem.png) no-repeat;"></span></a>
          </div>
        </div>
      </div> <!-- /.container -->
      </section>
    </div> <!-- /.navbar-inner -->
  </div> <!-- /.navbar navbar-fixed-top -->
  {% endblock header %}

  {% block main %}
  {% if announcements %}
  <div class="announcements-box">
    {% for announcement in announcements %}
      {% if announcement.show %}
      <div class="announcement">
        <h2>{{ announcement.title }}</h2>
          {{ announcement.content }}
      </div>
      {% endif %}
    {% endfor %}
  </div>
  {% endif %}
  {% endblock main %}
  <div id="outdated"></div>
  {% block footer %}
  {% include "./includes/footer.html" %}
  {% endblock footer %}
  {% block scripts %}
  <script type="text/javascript" src="{{ STATIC_URL }}lib/html5shiv/js/html5shiv.min.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}lib/jquery/js/jquery-1.9.1.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}lib/jquery/js/jquery-ui-1.10.3.custom.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}js/assets.min.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}lib/bootstrap-extend/js/jasny-bootstrap.min.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}lib/underscore/js/underscore-min.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}lib/backbone/js/backbone-min.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}lib/jquery/js/jquery.form-3.44.0.js"></script>
  <script type="text/javascript" src="{{ STATIC_URL }}lib/outdatedbrowser/outdatedbrowser.min.js"></script>
  {% endblock scripts %}

  {% block templates %}
  {% endblock templates %}

  {% block extra_script %}
  <script type="text/javascript"><!--
    var gem_oq_server_url = '{{ oq_engine_server_url }}';
    var disable_version_warning = {{ disable_version_warning|yesno:"true,false" }};
    //-->
    $( document ).ready(function() {
        outdatedBrowser({
            bgColor: '#1b75a5',
            color: '#fefefe',
            lowerThan: 'borderImage',
            languagePath: '{{ STATIC_URL }}lib/outdatedbrowser/lang/en.html'
        })
    })
  </script>
  {% endblock extra_script %}
  {% if application_mode != 'PUBLIC' %}
  {% include "./includes/cookie_bar.html" %}
  {% endif %}
</body>
</html>
